<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<title>login</title>
<link rel="stylesheet" type="text/css" href="/login_res/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="/login_res/css/demo.css" />
<link rel="stylesheet" type="text/css" href="/login_res/css/component.css" />
	<link rel="stylesheet" href="/pear/component/pear/css/pear.css" />
	<script src="/js/jquery-3.2.1.min.js"></script>
<![endif]-->

	<link rel="stylesheet"  href="/layui/css/layui.css">

</head>
<body>
		<div class="container demo-1">
			<div class="content">
				<div id="large-header" class="large-header">
					<canvas id="demo-canvas"></canvas>
					<div class="logo_box">
						<h3>欢迎你</h3>
						<div  name="userForm" method="get" id="loginUser">
							<div class="input_outer">
								<span class="u_user"></span>
								<input  name="name" id="name" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户" autofocus="false">
								<span class="check_uer" id="userExit" hidden></span>
								<span class="error_uer" id="userNotExit" hidden></span>
							</div>
							<div class="input_outer">
								<span class="us_uer"></span>
								<input name="pwd" id="pwd" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
							</div>
							<div class="input_outer">
								<span class="code_uer"></span>
								<input name="code" id="code" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入验证码">
							</div>
							<div class="mb2"><a class="act-email submit" href="javascript:;" style="color: white" onclick="sendCode()">发送验证码</a></div>
							<div class="mb2"><a type="submit" class="act-but submit" href="javascript:;" style="color: #FFFFFF" id="login">登录</a></div>

						</div>

					</div>
				</div>
			</div>
		</div><!-- /container -->
		<script src="/login_res/js/TweenLite.min.js"></script>
		<script src="/login_res/js/EasePack.min.js"></script>
		<script src="/login_res/js/rAF.js"></script>
		<script src="/login_res/js/demo-1.js"></script>
		<div style="text-align:center;">
</div>

	</body>
</html>
<script src="/pear/component/layui/layui.js"></script>
<script src="/pear/component/pear/pear.js"></script>
<script>
		layui.use(['form','loading'], function(){
			var form = layui.form;
			var loading = layui.loading;
			var $ = layui.$;

			$("#login").click(()=> {
				var name = $("#name").val();
				var pwd = $("#pwd").val();
				var code = $("#code").val();
				console.log("请求登录");
				$.ajax({
					url:"/login/mloginAjax",//前端得选择是根据不同的人确定不同的登录方式
					type:"post",
					data:{"name":name,"pwd":pwd,"code":code},
					dataType:"json",//返回的数据类型
					success:function(data){
						console.log(data);
						loading.Load(5,"登陆中...");
						loading.loadRemove(3000);
						setTimeout(()=>{
							window.location.href="/houtai/index";
						},3000)

					}
				})
			})
		});


	function signPage(){
		$('#signUser').show();
		$('#loginUser').hide();
	}
	// 登录界面
	function loginPage(){
		$('#signUser').hide();
		$('#loginUser').show();
	}

	function sendCode() {
		var name = $("#name").val();
		$.ajax({//发送Ajax请求
			url:"/login/msendEmail",
			type:"post",
			data:{"name":name},
			dataType:"json",//返回的数据类型
			success:function (data) {
			}
		});
	}

</script>